<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>vue的声明周期</title>
</head>

<body>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <div id="app">
  </div>
  <script>
    var vm = new Vue({
      data:{
        a:1
      },
      el: '#app',
      beforeCreate() {
        console.log(this.a)
      },
      created() {
        console.log(this.a)
      },
      beforeMount() {
        console.log(this)
      },
      mounted() { }
    })
  </script>
</body>

</html>